<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
	<ul class="nav nav-tabs">
		<li><a href="{:url('Doctor/index')}">医生列表</a></li>
		<li class="active"><a href="{:url('Doctor/create')}">添加医生</a></li>
	</ul>
	<form action="{:url('Doctor/update',['id'=>$data.d_id])}" method="post" class="form-horizontal js-ajax-form margin-top-20">
		<div class="row">
			<div class="col-md-9">
				<table class="table table-bordered">
					<tr>
						<th width="100px">医生名称<span class="form-required">*</span></th>
						<td>
							<input class="form-control" type="text" name="d_name"
								   id="d_name" required value="{$data.d_name}" placeholder="请输入医生名称"/>
						</td>
					</tr>
					<tr>
						<th width="100px">医生简介<span class="form-required">*</span></th>
						<td>
							<input class="form-control" type="text" name="d_desc"
								   id="d_desc" required value="{$data.d_desc}" placeholder="请输入医生简介"/>
						</td>
					</tr>
					<tr>
						<th width="100px">医生擅长领域<span class="form-required">*</span></th>
						<td>
							<input class="form-control" type="text" name="d_shanchang"
								   id="d_shanchang" required value="{$data.d_shanchang}" placeholder="请输入医生擅长领域"/>
						</td>
					</tr>
					<tr>
						<th width="100px">每日预约上限<span class="form-required">*</span></th>
						<td>
							<input class="form-control" type="text" name="d_topnum"
								   id="d_topnum" required value="{$data.d_topnum}"  placeholder="请输入每日预约上限"/>
						</td>
					</tr>









				</table>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
						<a class="btn btn-default" href="{:url('Doctor/index')}">{:lang('BACK')}</a>
					</div>
				</div>
			</div>
			<div class="col-md-3">
				<table class="table table-bordered">
					<tr>
						<th><b>医生头像</b></th>
					</tr>
					<tr>
						<td>
							<div style="text-align: center;">
								<input type="hidden" name="d_head" id="thumbnail" value="{$data.d_head}">
								<a href="javascript:uploadOneImage('图片上传','#thumbnail');">
									<empty name="$data['d_head']">
									<img src="__TMPL__/public/assets/images/default-thumbnail.png"
										 id="thumbnail-preview"
										 width="135" style="cursor: pointer"/>
									<else />
									<img src="/upload/{$data.d_head}"
											 id="thumbnail-preview"
											 width="135" style="cursor: pointer"/>
									</empty>
								</a>
								<input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
							</div>
						</td>
					</tr>
				</table>
			</div>
			<div class="col-md-3">
				<table class="table table-bordered">
					<tr>
						<th><b>医生二维码</b></th>
					</tr>
					<tr>
						<td>
							<div style="text-align: center;">
								<input type="hidden" name="d_erwei" id="thumbnail2" value="{$data.d_erwei}">
								<a href="javascript:uploadOneImage('图片上传','#thumbnail2');">
									<empty name="$data['d_erwei']">
									<img src="__TMPL__/public/assets/images/default-thumbnail.png"
										 id="thumbnail2-preview"
										 width="135" style="cursor: pointer"/>
									<else />
									<img src="/upload/{$data.d_erwei}"
											 id="thumbnail-preview"
											 width="135" style="cursor: pointer"/>
									</empty>
								</a>
								<input type="button" class="btn btn-sm btn-cancel-thumbnail2" value="取消图片">
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    $(function () {

        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        try {
            editorcontent.sync();
        } catch (err) {
        }

        $('.btn-cancel-thumbnail').click(function () {
            $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#thumbnail').val('');
        });


    });
</script>
</body>
</html>
